package de.mmis.core.base.abstracttree.serializer;

import java.util.Map;

import de.mmis.core.base.abstracttree.Tree;

/**
 * interface for objects that can be serialized to a {@link Tree}.<br>
 * 
 * @author Christian Koch
 */
public interface Serializable {

	/**
	 * @return String implicitly prepended to the Tree to uniquely and
	 *         platform-independently identify objects of this type. Use
	 *         <code>null</code> if no ID is required <br>
	 *         <b>IMPORTANT</b>: There must be a resource with exactly the same
	 *         name available from the classloader in path
	 *         "de/mmis/core/base/serializer" containing the deserialization
	 *         class for deserialization to work properly.
	 */
	public String getTypeIdentifier();

	/**
	 * @return {@link Tree} representation of serializable Object
	 */
	public Tree[] serialize(boolean explicit, Map<Object, String> refmap,
			ClassLoader classLoader);
}
